package com.projet.segmiMap.activities;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.projet.segmiMap.R;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;

/**
 * Created with IntelliJ IDEA.
 * User: Julien
 * Date: 10/12/13
 * Time: 20:58
 * Cette classe permet de redéfinir la fenêtre à afficher au clique sur un Marker
 */
public class SegmiWindow implements GoogleMap.InfoWindowAdapter {
    LayoutInflater inflater = null;
    private TextView textView;

    public SegmiWindow(LayoutInflater inflater) {
        this.inflater = inflater;
    }

    @Override
    public View getInfoWindow(Marker marker) {
        return (null);
    }

    @Override
    public View getInfoContents(Marker marker) {
        View popup = inflater.inflate(R.layout.segmiwindow, null);

        textView = (TextView) popup.findViewById(R.id.title);
        textView.setText(marker.getTitle());

        textView = (TextView) popup.findViewById(R.id.snippet);
        textView.setText(marker.getSnippet());

        return (popup);
    }
}
